package com.qbccn.bbs.config.custom;

import javax.servlet.http.HttpServletRequest;
import org.apache.ibatis.javassist.NotFoundException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author linke
 * @date 2020/5/31 0:16
 * @description 自定义异常
 */
@ControllerAdvice
public class CustomExceptionHandler {

  //404异常
  @ExceptionHandler(value = NotFoundException.class)
  public String handleException(NotFoundException e, HttpServletRequest request) {
    return "error/404";
  }
}
